$(function(){
    binDeleteEvent();
    binDeleteConfirmEvent();
    });

function binDeleteEvent(){
    $(".btn_delete").click(function (){
        DELETE_CID = $(this).attr("cid")
        console.log($(this).attr("cid"))
    })
}
function binDeleteConfirmEvent() {
    $("#btnConfirm").click(function (){
        // console.log("确定删除")
        // console.log(DELETE_CID)
        $.ajax({
            url: DELETE_URL,
            type: "GET",
            data: {cid: DELETE_CID},
            dataType:"json",
            success:function(res){
                if (res.status){
                    $("tr[row-id='" + DELETE_CID + "']").remove();
                    $(".delete_model").modal("hide");

                }
                else{
                    $("#deleteError").text(res.detail)
                }
            }
        })
        }
    )

}